An unmanned vehicle such as an unmanned aerial vehicle (UAV) can be used for various applications, such as performing surveillance, reconnaissance, and exploration tasks in a wide variety of environments for military and civilian applications. A UAV may also be used in various delivery applications, including delivery of chemicals to crops in agriculture. A UAV may comprise one or more sensors for collecting information regarding its environment and the UAV may employ such information for obstacle avoidance. The ability of a UAV to avoid obstacles during flight may be advantageous, for example to both prevent damage to the UAV and facilitate completion of its tasks.